import { typeAction } from '../reducer/todo';

// rxaction
export const updateByIdAction = (id: number): typeAction => ({
  type: 'todo/updateById',
  payload: id,
});
export const deleteByIdAction = (id: number): typeAction => ({
  type: 'todo/deleteById',
  payload: id,
});

export const clearDoneAction = (): typeAction => ({
  type: 'todo/clearDone',
});

export const addMsgAction = (msg: { id: number; task: string; isDone: boolean }): typeAction => ({
  type: 'todo/addMsg',
  payload: msg,
});
export const changeStatusAction = (msg: string): typeAction => ({
  type: 'todo/changeStatus',
  payload: msg,
});

export const checkedAllAction = (msg: boolean): typeAction => ({
  type: 'todo/checkedAll',
  payload: msg,
});
